package server;

import client.*;
import java.util.*;

/**
 * Utils
 *
 * Utility class used to generate data for the demo
 *
 * @author Masud Idris
 * @version 1.0
 * @since Dec 18, 2007, 9:51:22 PM
 */
public class Utils {
  public static final String[] CONTACT_NAMES =      {"Dolores Matthews",
                                                     "Evrett Jablonsky",
                                                     "John Random",
                                                     "Trevor Haskell",
                                                     "Maximus Minimus",
                                                     "Bob",
                                                     "Filliam H. Muffman"};

  public static final String[] CONTACT_EMAILS =     {"ass@tonishing.com",
                                                     "jablonsky@jablonsky.org",
                                                     "random@john.net",
                                                     "trevor@really-lame-webmail-site.org",
                                                     "maxmin@minmax.co.uk",
                                                     "bob@nondescript.com",
                                                     "i-am-running-out-of@ideas.for.emails.com"};

  public static final String[] CONTACT_ADDRESSES =  {"4444 Wisteria Lane,<br>Fairview , USA",
                                                     "15545-B Jablonsky Court,<br>Jablonskyville, Kansas, USA",
                                                     "22 Wintherthur Ave,<br>Mulberry, VA, USA",
                                                     "22 Waka Waka Lane, Crazytown, USA",
                                                     "221B Baker Street,<br>London, UK",
                                                     "Second star to the right, and straight on till morning...",
                                                     "The mind of Stephen Colbert"};


  public static final String[] CONTACT_PHONES =     {"555-1123",
                                                     "1-800-JAB-LONSKY",
                                                     "N/A",
                                                     "222-999-0987",
                                                     "011-44-111-222-3456",
                                                     "N/A",
                                                     "111-222-3334"};



  /**
   * Method used to generate a contact list
   * @return returns an ArrayList containing a bunch of contacts
   */
  public static ArrayList<Contact> generateContacts() {
    ArrayList<Contact> contactList = new ArrayList<Contact>();

    // Generate the contact list
    for (int i=0; i<CONTACT_NAMES.length; i++) {
      Contact contact = new Contact();
      contact.setName(CONTACT_NAMES[i]);
      contact.setEmail(CONTACT_EMAILS[i]);
      contact.setAddress(CONTACT_ADDRESSES[i]);
      contact.setPhoneNumber(CONTACT_PHONES[i]);
      contactList.add(contact);
    }

    return contactList;
  }

}//end class Utils
